import java.util.*;

// HJ81 字符串字符匹配
 public class HJ81 {

     public static void main(String[] args) {
         Scanner sc = new Scanner(System.in);
         while (sc.hasNext()) {
             String str = sc.nextLine();
             String s = sc.nextLine();
             char[] ch = s.toCharArray();
             char[] ch2 = str.toCharArray();
             boolean flag = true;
             Map<Character, String> map = new HashMap();
             for(int i=0; i<ch.length; i++){
                 if(!map.containsKey(ch[i])){
                     map.put(ch[i], "");
                 }
             }
             for(int i=0; i<ch2.length; i++){
                 if(!map.containsKey(ch2[i])){
                     flag = false;
                 }
             }
             System.out.println(flag);
         }
     }
 }

